package com.caotv.wkreport.action;
/**
 * @author bau
 *
 */
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.ServletActionContext;

import com.caotv.wkreport.dao.Rooms;
import com.caotv.wkreport.dbutils.RoomsTableTool;
import com.caotv.wkreport.dbutils.UserTableTool;
import com.opensymphony.xwork2.ActionSupport;


public class roomBookInformationViewAction extends ActionSupport{
	
	private List<Rooms> listRooms = null;
	private Rooms room = new Rooms();
	
	public String execute() {
		listRooms= RoomsTableTool.getInstance().getAllRooms();

		return "success";
	}
	
	public String viewRoomBookingInformation(){
		System.out.println("\nRunning viewRoomBookingInformation Function!!!\n");
		HttpServletRequest request = ServletActionContext.getRequest();
		int id =Integer.parseInt(request.getParameter("id"));
		room = RoomsTableTool.getInstance().getRoomByID(id);

		return "success";
	}
	
	public Rooms getRoom() {
		return room;
	}

	public void setRoom(Rooms room) {
		this.room = room;
	}

	public List<Rooms> getListRooms() {
		return listRooms;
	}

	public void setListRooms(List<Rooms>listRooms) {
		this.listRooms = listRooms;
	}
}
